#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using pii = pair < int , int >;
using vec = vector < int >;
using veg = vector < pii >;
using ll = long long;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 1e5 + 10;

int ocnt[N], ecnt[N], n, m, cnto, ans, dep[N];
bool isr[N], vis[N];
veg G[N];

void dfs(int x, int p) {
	vis[x] = true; 
	for(auto [y, i] : G[x])
		if(i ^ p) {
			if(!vis[y]) dep[y] = dep[x] + 1, dfs(y, i), ocnt[x] += ocnt[y], ecnt[x] += ecnt[y];
			else if(dep[x] > dep[y]) {
				if(dep[x] - dep[y] & 1) ecnt[x]++, ecnt[y]--;
				else ocnt[x]++, ocnt[y]--, cnto++;
			}
		}
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    n = in, m = in; rep(i, 1, m) { int u = in, v = in; G[u].pb({ v, i }); G[v].pb({ u, i }); }
	rep(i, 1, n) if(!vis[i]) dfs(i, 0), isr[i] = true;
	ans = cnto == 1; 
	rep(i, 1, n) if(!isr[i] && !ecnt[i] && ocnt[i] == cnto) ans++;
	cout << ans << endl; return 0;
}
